﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Graphics;

namespace Babylon.ContentPipelineExtensions
{
    [ContentProcessor]
    public class DudeDiffuseProcessor : TextureProcessor
    {
        public override Microsoft.Xna.Framework.Content.Pipeline.Graphics.TextureContent Process(Microsoft.Xna.Framework.Content.Pipeline.Graphics.TextureContent input, Microsoft.Xna.Framework.Content.Pipeline.ContentProcessorContext context)
        {

            for (int j = 0; j < input.Faces[0].Count; j++)
            {
                var data = input.Faces[0][j].GetPixelData();
                for (int i = 0; i < data.Length; i += 4)
                {
                    data[i + 3] = 255;
                }
                input.Faces[0][j].SetPixelData(data);
            }
            return base.Process(input, context);
        }
    }
}
